﻿using System;
using System.Collections.Generic;
using System.Linq;
using Citi.GocAttributes.Domain;

namespace Citi.GocAttributes.WebUI.Models
{
    public class ImportHistoryModel : ModelBase<ImportHistoryModel, ImportHistory>
    {
        public string FileName { get; set; }
        public DateTime UploadDate { get; set; }
        public List<ImportErrorModel> ImportErrors { get; set; }
        public string Status
        {
            get
            {
                if (!ImportErrors.Any())
                    return "Imported";

                return string.Format("Not imported: {0} errors", ImportErrors.Count());
            }
        }
    }
}